/**
 * Created by fuqunchao on 16/4/3.
 */
var dataMap = {};
function dataFormatter(obj) {
    var pList = ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'];
    var temp;
    for (var year = 2011; year <= 2015; year++) {
        var max = 0;
        var sum = 0;
        temp = obj[year];
        for (var i = 0, l = temp.length; i < l; i++) {
            max = Math.max(max, temp[i]);
            sum += temp[i];
            obj[year][i] = {
                name : pList[i],
                value : temp[i]
            }
        }
        obj[year + 'max'] = Math.floor(max / 100) * 100;
        obj[year + 'sum'] = sum;
    }
    return obj;
}

dataMap.dataAttr5 = dataFormatter({
    2015:[191,102,229,187,218,220,208,168,163,132,174,191],
    2014:[211,164,217,239,206,218,244,198,197,190,224,263],
    2013:[211,125,250,204,431,335,242,261,208,181,180,214],
    2012:[175,244,248,171,627,498,308,333,298,50,176,215],
    2011:[193,125,690,484,818,664,434,403,334,295,308,382]
});

dataMap.dataAttr4 = dataFormatter({
    2015:[2,2,0,2,7,4,2,25,17,15,5,2],
    2014:[15,7,3,3,29,11,2,3,6,17,11,12],
    2013:[15,0,45,9,10,0,5,5,10,7,9,33],
    2012:[24,14,40,30,0,10,5,0,0,0,0,6],
    2011:[7,6,28,13,13,21,14,20,0,54,74]
});

dataMap.dataAttr3 = dataFormatter({
    2015:[24,24,45,35,30,36,58,61,76,62,75,82],
    2014:[69,40,50,28,32,40,39,42,62,42,25,22],
    2013:[7,0,146,80,81,54,51,56,55,64,56,89],
    2012:[94,65,65,30,55,46,65,61,22,1,9,1],
    2011:[15,5,176,52,95,77,73,91,88,78,94,73]
});

dataMap.dataAttr2 = dataFormatter({
    2015:[53,36,52,40,28,38,35,31,23,18,29,25],
    2014:[53,59,36,43,60,38,45,50,49,27,37,51],
    2013:[6,1,295,296,195,146,135,116,117,94,113,83],
    2012:[30,23,33,11,16,9,20,13,2,1,6,4],
    2011:[19,6,87,57,87,77,30,24,51,18,16,13]
});

dataMap.dataAttr1 = dataFormatter({
    2015:[4,1,4,3,5,1,5,3,0,0,0,1],
    2014:[0,0,0,4,6,3,5,4,3,7,3,3],
    2013:[5,2,4,2,3,9,1,3,2,4,2,3],
    2012:[4,2,4,1,5,5,11,0,0,0,3,5],
    2011:[4,0,3,9,2,1,3,12,1,0,2,2]
});
